﻿using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp;
using Volo.Abp.Application.Dtos;

namespace Acme.BookStore2.Controllers
{
    [RemoteService(Name = "Default")]
    [Area("bookstore2")]
    [ControllerName("VehicleRepairRecord")]
    [Route("api/bookstore2/VehicleRepairRecords")]
    public class VehicleRepairRecordController : BookStore2Controller, IVehicleRepairRecordAppService
    {
        private readonly IVehicleRepairRecordAppService _vehicleRepairRecordAppService;

        public VehicleRepairRecordController(IVehicleRepairRecordAppService vehicleRepairRecordAppService)
        {
            this._vehicleRepairRecordAppService = vehicleRepairRecordAppService;
        }
        
        [HttpGet]
        [Route("{id}")]
        public Task<VehicleRepairRecordDto> GetAsync(Guid id)
        {
            return _vehicleRepairRecordAppService.GetAsync(id);
        }
        
        [HttpGet]
        public Task<PagedResultDto<VehicleRepairRecordDto>> GetPagedListAsync(GetVehicleRepairRecordsInput input)
        {
            return _vehicleRepairRecordAppService.GetPagedListAsync(input);
        }
        
        [HttpPost]
        public Task<VehicleRepairRecordDto> CreateAsync(VehicleRepairRecordCreateDto input)
        {
            return _vehicleRepairRecordAppService.CreateAsync(input);
        }

        [HttpPut]
        [Route("{id}")]
        public Task<VehicleRepairRecordDto> UpdateAsync(Guid id, VehicleRepairRecordUpdateDto input)
        {
            return _vehicleRepairRecordAppService.UpdateAsync(id, input);
        }

        [HttpDelete]
        [Route("{id}")]
        public Task DeleteAsync(Guid id)
        {
            return _vehicleRepairRecordAppService.DeleteAsync(id);
        }

        [HttpGet] 
        [Route("export")]
        public Task ExportAsync(GetVehicleRepairRecordsInput input)
        {
            return _vehicleRepairRecordAppService.ExportAsync(input);
        }
    }
}